package igraf;

import java.io.FileInputStream;
import java.sql.Connection;
import java.sql.DriverManager;
import java.util.Properties;

public class Inport {
	
	@SuppressWarnings("unused")
	private Connection konexioa;

	public Inport(){}
	
	public void kon(){
		try {

			Properties props = new Properties();
			FileInputStream file = new FileInputStream(
					"./konfig/datubasea.properties");
			props.load(file);
			file.close();

			Class.forName("com.mysql.jdbc.Driver");
			String url = props.getProperty("jdbc.url");
			String erab = props.getProperty("jdbc.username");
			String pass = props.getProperty("jdbc.password");
			konexioa = DriverManager.getConnection(url, erab, pass);

			System.out.println("Database connection established");
		} catch (Exception e) {
			System.err.println("Cannot connect to database server");
		}
	}
	}


